Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Relax type of get_route_name argument to HttpConnection #276

Merged
merged 4 commits into from
Mar 10, 2024

Conversation

pajowu
Copy link
Contributor

@pajowu pajowu commented Nov 20, 2023

What does this do?

This pr changes the type hint of get_route_name to accept a HttpConnection instead of a Request. All information get_route_name needs is already provided by the HttpConnection class, which Request is a subclass of. Changing this to HttpConnection allows also passing a WebSocket instead

Why do we need it?

This allows developers to use the get_route_name function for getting the name of websocket routes as well, which can be very useful for creating custom metrics, e.g. https://github.com/bugbakery/transcribee/pull/389/files#diff-82bbfd4c38c16c9ba393ea259a91bd7a73077f6edc59368d492fe172ac933625R39

Who is this for?

People who want to create own metrics for websocket routes.

@pajowu pajowu changed the title Relax type of get_route_name argument to HttpConnection feat: Relax type of get_route_name argument to HttpConnection Nov 20, 2023
All information required is already provided by the HttpConnection class, which Request is a subclass of. Changing this to HttpConnection allows also passing a WebSocket instead
Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.68%. Comparing base (85f72b7) to head (ee2adf3).

❗ Current head ee2adf3 differs from pull request most recent head 8ba359a. Consider uploading reports for the commit 8ba359a to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #276   +/-   ##
=======================================
  Coverage   95.68%   95.68%           
=======================================
  Files           5        5           
  Lines         348      348           
=======================================
  Hits          333      333           
  Misses         15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trallnag trallnag merged commit 885c80c into trallnag:master Mar 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants